Repository navigation
feat(proc): killGroup, the group kill run uses, for a signal handler - #20
Merged
Merged
Conversation
A handler that kills the child run is waiting on, by the pgid that Options.pgid_out published, had kill(-pgid), which misses a child that has not made its group yet, or stopGroup, which also waits for the group to go. killGroup is the kill run itself uses: the group, or while there is no such group the child itself and then the group again. It makes only kill system calls, so a handler may call it, and ignores a pgid of 0 or less, which kill would take for the caller's own group. The test calls it from a handler, on a child that has not made its group and on one that has, and fails without the fallback or the guard.
HaoZeke
force-pushed
the
feat/kill-group
branch
from
November 16, 2026 11:36
55daaf6 to
05ef1f4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
proc.killGroup(pgid, sig)makes public the group kill thatrunuses, for signal handlers. It signals the process group thatOptions.pgid_outpublished. While the child has not made that group yet, it signals the child itself and then the group again. A pgid of 0 or less does nothing, so a handler cannot signal its own process group by accident.It makes only
killsystem calls and does not wait, so it is safe in a signal handler.run,stopGroupandwaitGroupGonenow use it, with no change in behaviour. The new test calls it on a child before and after the child has made its group, and fails without either the fallback or the guard.This would ship in v0.9.0.